package studay.factory;

import studay.factory.ali.AliOrderFactory;
import studay.factory.wechat.WeChatOrderFactory;

/**
 * @program: 设计模式
 * @description: 超级工厂创造器
 * @author: Tom
 * @create: 2022-01-05 22:22
 **/
public class FactoryProducer {

    public static OrderFactory getFactory(String type){
        if(type.equalsIgnoreCase("WECHAT")){
            return new WeChatOrderFactory();
        }else if(type.equalsIgnoreCase("ALI")) {
            return new AliOrderFactory();
        }
        return null;
    }
}
